<?php
session_start();
$GroupID=$_session['GroupID'];
$G_Name=$_session['G_Name'];
$Disc_ID=$_session['Disc_ID'];
$_session['temp']=$temp;

$dbConn=odbc_connect('EventDB','MyUser','Temp123');

$col_name = array();

$sql = "select * from Groups";
$rs_groups = odbc_exec($dbConn, $sql);

$num_Fields = odbc_num_Fields($rs_groups);


For ($i=1; $i<=$num_Fields; $i++)
{
	$col_name[$i] = odbc_field_name($rs_groups,i); 
};

For ($i=1; $i<=$num_Fields; $i++){
	echo "<br></br>";
	echo $col_name[$i];
};


if ($col_name[1] == "")
	{
echo "<html><body><p>NO result set returned!!</p></body></html>";
	}
	elseif ($GroupID == "")	
	{
	echo "<html><body><p>NO Groups returned!!</p></body></html>";
	};
	else
	{
	$sql="insert_into_Groups_Values ('".$GroupID."','".$G_Name."','".$Disc_ID."')";
	echo $sql; 
	$rs_groupsins=odbc_exec($EventDB,$sql);
	odbc_close($EventDB);
	echo  "<html><body><p>Data inserted succesfully!!</p></body></html>";
	}; 
	
};


?>